<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
    <title>AWS SDK for OpenResty</title>
    <link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
	<div id="product_logo"></div>
	<div id="product_name"><big><b></b></big></div>
	<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<br/>
<h1>lua-resty-aws</h1>


<ul>
  <li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>


<h2>Classes</h2>
<ul class="nowrap">
  <li><a href="../classes/AWS.html">AWS</a></li>
  <li><strong>ChainableTemporaryCredentials</strong></li>
  <li><a href="../classes/CredentialProviderChain.html">CredentialProviderChain</a></li>
  <li><a href="../classes/Credentials.html">Credentials</a></li>
  <li><a href="../classes/EC2MetadataCredentials.html">EC2MetadataCredentials</a></li>
  <li><a href="../classes/EnvironmentCredentials.html">EnvironmentCredentials</a></li>
  <li><a href="../classes/RemoteCredentials.html">RemoteCredentials</a></li>
  <li><a href="../classes/SharedFileCredentials.html">SharedFileCredentials</a></li>
  <li><a href="../classes/TokenFileWebIdentityCredentials.html">TokenFileWebIdentityCredentials</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
  <li><a href="../modules/resty.aws.config.html">resty.aws.config</a></li>
  <li><a href="../modules/resty.aws.service.rds.signer.html">resty.aws.service.rds.signer</a></li>
  <li><a href="../modules/resty.aws.utils.html">resty.aws.utils</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
  <li><a href="../topics/README.md.html">README</a></li>
</ul>

</div>

<div id="content">

<h1>Class <code>ChainableTemporaryCredentials</code></h1>
<p>ChainableTemporaryCredentials class.</p>
<p>

</p>


<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#aws:ChainableTemporaryCredentials">aws:ChainableTemporaryCredentials (opt)</a></td>
	<td class="summary">Constructor, inherits from <a href="../classes/Credentials.html#">Credentials</a>.</td>
	</tr>
</table>

<br/>
<br/>


    <h2 class="section-header "><a name="Functions"></a>Functions</h2>

    <dl class="function">
    <dt>
    <a name = "aws:ChainableTemporaryCredentials"></a>
    <strong>aws:ChainableTemporaryCredentials (opt)</strong>
    </dt>
    <dd>
    Constructor, inherits from <a href="../classes/Credentials.html#">Credentials</a>.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">opt</span> options table, additional fields to the <a href="../classes/Credentials.html#">Credentials</a> class:
        <ul>
        <li><span class="parameter">params</span>
         params table for the <code>assumeRole</code> function, or array of those
 tables in case of a chain of roles to assume.
        </li>
        <li><span class="parameter">aws</span>
         <a href="../classes/AWS.html#">AWS</a> instance, required when creating a chain.
        </li>
        <li><span class="parameter">masterCredentials</span>
         <a href="../classes/Credentials.html#">Credentials</a> instance to use when assuming the
 role. Defaults to <code>sts.config.credentials</code> or <code>aws.config.credentials</code> in that
 order.
        </li>
        <li><span class="parameter">sts</span>
         the <code>STS</code> service instance to use for fetching the credentials.
 Defaults to a new instance created as <code>aws:STS()</code>.
        </li>
        </li></ul>
    </ul>




    <h3>Usage:</h3>
    <ul>
        <pre class="example"><span class="comment">-- creating a chain of assumed roles
</span><span class="keyword">local</span> aws = <span class="function-name">AWS</span>()      <span class="comment">-- provides the masterCredentials
</span><span class="keyword">local</span> role1 = { ... }  <span class="comment">-- parameters to assume role1, from the masterCredentials
</span><span class="keyword">local</span> role2 = { ... }  <span class="comment">-- parameters to assume role2, from the role1 credentials
</span><span class="keyword">local</span> role3 = { ... }  <span class="comment">-- parameters to assume role3, from the role2 credentials
</span>
<span class="keyword">local</span> creds = aws:<span class="function-name">ChainableTemporaryCredentials</span> {
    params = { role1, role2, role3 },
  }

<span class="comment">-- Get credentials for role3
</span><span class="keyword">local</span> success, id, key, token, expiretime = creds:<span class="function-name">get</span>()
<span class="keyword">if</span> <span class="keyword">not</span> success <span class="keyword">then</span>
  <span class="keyword">return</span> <span class="keyword">nil</span>, id
<span class="keyword">end</span></pre>
    </ul>

</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
<i style="float:right;">Last updated 2024-08-02 07:27:49 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>
